#ifndef DEXWM_H
#define DEXWM_H

#include <QApplication>
#include <QHash>

class DexWin;

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>

class DexWM : public QApplication
	{
		public:
			DexWM(int &, char **);
			~DexWM();

		protected:
			virtual Atom getWindowType(Window);
			virtual bool isWinAlreadyMapped(Window);
			virtual void handleConfigureRequest(Window);
			virtual void handleDestroyNotify(Window);
			virtual void handleMapRequest(Window);
			virtual void handleUnmapNotify(Window/*, bool b = false*/);
			virtual bool x11EventFilter(XEvent *);

		private:
			void resolveAtoms();

			QHash<Window, DexWin*> clients;
			// ICCCM
			Atom d_WM_PROTOCOLS;
			Atom d_WM_DELETE_WINDOW;
			Atom d_WM_CHANGE_STATE;
			Atom d_WM_STATE;
			Atom d_WM_TAKE_FOCUS;
			// EWMH
			Atom d_NET_WM_NAME;
			Atom d_NET_WM_ICON;
			Atom d_NET_SUPPORTED;
			Atom d_NET_WM_USER_TIME;
			Atom d_NET_WM_STATE;
			Atom d_NET_WM_WINDOW_TYPE;
			Atom d_NET_WM_WINDOW_TYPE_NORMAL;
			Atom d_NET_WM_WINDOW_TYPE_DESKTOP;
			Atom d_NET_WM_WINDOW_TYPE_DIALOG;
			Atom d_NET_WM_WINDOW_TYPE_UTILITY;
			Atom d_NET_WM_WINDOW_TYPE_SPLASH;
			Atom d_NET_WM_WINDOW_TYPE_DOCK;
			Atom d_NET_WM_WINDOW_TYPE_TOOLBAR;
			Atom d_KDE_NET_WM_SYSTEM_TRAY_WINDOW;
			Atom d_NET_WM_STRUT;
			Atom d_NET_WM_STRUT_PARTIAL;
			//
	};

#endif // DEXWM_H
